# import numpy as np
# arr = np.array([[1,2,3],[4,5,6],[7,8,9],[10,11,12]])
# print('4*4的整数数组: \n',arr)
# print('数组的ndim属性：',arr.ndim)
# print('数组的shape属性:',arr.shape)
# print('数组的size属性:',arr.size)
# print('数组的dtype属性:',arr.dtype)


# import numpy as np
# arr=np.array([1,2,3,4,5,6,7,8,9])
# print(arr[2])
# print(arr[1:5])
# print(arr[:8:2])
# print(arr[::3])

import numpy as np
arr = np.array([[1,2,3,4],[5,6,7,8],[9,10,11,12]])
print('3*4的数组:n',arr)
print('第一行第三列的元素:',arr[0,2])
print('第1~2行第2~3列的元素:\n',arr[0:2,1:3])
print('第3行,列步长为2的元素:', arr[2,::2])
print('行步长为2，第1~2列的元素：\n',arr[::2,:2])
